<%-- 
    Document   : DaftarStudio
    Created on : 25 Nov 11, 14:07:27
    Author     : Jeanot Nahasan
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@page import="Entities.*"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.util.GregorianCalendar"%>
<%@page import="java.util.Calendar"%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Daftar Studio</title>
        <link href="style.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        
        
        <div id="wrapper">    
            <div id="header">
                <h1>Sistem Pembantu Penjadwalan Studio Musik</h1> versi sesuatu.86
            </div>
            <div id="nav">
                <ul>
                                    <%Calendar calz = new GregorianCalendar();%>
            <li><a href="?action=menuUser&month=<%=calz.getTime().getMonth()+1%>&year=<%=calz.getTime().getYear()+1900%>"> Home User </a></li>
                    <li class="selected"><a href="?action=studio"> Tambah Studio</a></li>
                    <li><a href="?action=logout"> Logout </a></li>
                </ul>
            </div>
            <div id="nav2">
                <a href="?action=menuUser&month=<%=calz.getTime().getMonth()+1%>&year=<%=calz.getTime().getYear()+1900%>">Home </a>&#187; Daftar Studio
                
            </div>
            <br/>
            <% DBConnection conn = new DBConnection();
            String query = "select ID_STUDIO,HARGA_SEWA_STUDIO,JENIS_STUDIO,STUDIO_STATUS from STUDIO ";
            ResultSet studioResult = conn.select(query);
            %>
            
            <div id="conten_studio">
                <h2>Daftar Studio</h2>
                <%
            while (studioResult.next()) {%>
                <div id="detail_studio">
                    <% out.println("<div id='detail_studio_id'> <b> " + studioResult.getString("ID_STUDIO") + "</b></div>");%>
                    <% out.println("<div id='detail_studio_data'>Harga Sewa : " + studioResult.getString("HARGA_SEWA_STUDIO") + "<br/>");%>
                    <% out.println("Jenis Studio : " + studioResult.getString("JENIS_STUDIO") + "<br/>");%>
                    <% out.println("Studio Status: " + studioResult.getString("STUDIO_STATUS") + "<br/>");%>
                    <a href="?action=DataStudio&idstudio=<%=studioResult.getString("ID_STUDIO")%>">EDIT</a></div>
                </div>
                <% }
                %>
            </div>
            
            <div id="formStudio">
                <%
            if (request.getAttribute("error") != null) {
                %>
                <div id="proses_error">Input Gagal!!! pastikan field yang bertanda asterik (*) tidak kosong dan anda hanya menginput angka pada field Harga Penyewaan..!!</div>
                <%
            } 
                %>
                <table width="100%">
                <form action="ControllerServlet" method="get" id="boxForm">
                    <input type="hidden" name="action" value="addStudio">
                    <tr><td colspan="2"><hr><H3>Tambah Studio</H3><HR></td>
                        <td></td>
                    </tr>
                    
                    <tr>  <td>Harga Penyewaan</td>      
                        <td> <input class="input" id="input" type="text" name="hargaPenyewaan" size="15" maxlength="7">*</td>    
                    </tr>
                    <tr>  <td>Jenis Studio : </td>      
                        <td> 
                            <input type="radio" checked name="jenisStudio" value="rekaman"> Rekaman <br/>
                            <input type="radio" name="jenisStudio" value="latihan"> Latihan
                        </td>    
                    </tr>
                    <tr>  <td>Detail Studio</td>      
                        <td> <input class="input" id="input" type="textarea" name="detailStudio" size="25"></td>    
                    </tr>
                    <tr>
                        <td></td>
                        <td><input TYPE=SUBMIT VALUE="Buat" class="button-primary" tabindex="100" /></td>
                    </tr>
                </form>
            </div>
            
            
        </div>
    </body>
</html>
